package emulator.unittest.hardware.nmos6502.timing;


import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import emulator.EmulatorException;

public class ZeroPageYTest {

	TimingTestBase test_base = null;
	
	@Before
	public void setUp() throws Exception {
		test_base = new TimingTestBase();
	}
	
	@Test
	public void testLDX() throws EmulatorException
	{
		assertEquals(4, getCycles(0xB6));
	}
	
	@Test
	public void testSTX() throws EmulatorException
	{
		assertEquals(4, getCycles(0x96));
	}
	
	private int getCycles(int opcode) throws EmulatorException
	{
		test_base.setCommand(0, opcode, 0x44, 0);
		test_base.execute();
		return test_base.getElapsedCycles();
	}
}
